<script setup>
const props = defineProps({
  options: {
    type: Object,
    default: () => {
      return {}
    }
  },
  data: {
    type: Array,
    default: () => {
      return []
    }
  }
})

const tAnimationConfig = computed(() => {
  return {
    Basis: 'x',
    Duration: 2000,
    Length: props.options.xAxis ? props.options.xAxis.data.length : 99
  }
})
</script>

<template>
  <div style="width: 100%; height: 100%">
    <dv-border-box7 class="my-box7" :color="['#0749a3', '#4195d2']">
      <div class="dom-box">
        <div class="dom-title">点检维保动态</div>
        <div class="dom-content">
          <div class="dom-list">
            <div class="dom-list-item" v-for="(item, index) in props.data" :key="index">
              <div>{{ item.ClassName }}</div>
              <div class="total" :style="{ color: item.Color }">{{ item.Total }}</div>
            </div>
          </div>

          <div class="chart-content">
            <ps-chart2 :option="props.options" />
          </div>
        </div>
      </div>
    </dv-border-box7>
  </div>
</template>

<style scoped lang="scss">
@font-face {
  font-family: 'UnidreamLED';
  src: url(../../../assets/font/DS-Digital/DS-DIGI-1.ttf); /***兼容ie9***/
}

.dom-list {
  display: flex;
  justify-content: space-evenly;
  color: #fff;
  &-item {
    padding: 4px ;
    font-size: 14px;
    background-color: #01275d;

    .total {
      font-size: 30px;
      font-family: UnidreamLED;
      font-weight: bold;
      text-align: center;
    }
  }
}
.dom-box {
  display: flex;
  flex-direction: column;
  height: 100%;

  .dom-title {
    height: 40px;
    background-color: rgba(14, 58, 119, 0.6);
    color: #2ca7e2;
    line-height: 40px;
    padding-left: 20px;
  }

  .dom-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .chart-content {
    flex: 1;
    overflow: hidden;

    height: calc(100% - 70px);
  }
}
</style>
